Revert "nfsd4: remove check_conflicting_opens warning"
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 8 Mar 2021 15:51:51 +0000 (10:51 -0500)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 19 Mar 2021 18:20:52 +0000 (18:20 +0000)
commit 4aa5e002034f0701c3335379fd6c22d7f3338cce upstream.

This reverts commit 50747dd5e47b "nfsd4: remove check_conflicting_opens
warning", as a prerequisite for reverting 94415b06eb8a, which has a
serious bug.

Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name revert-nfsd4-remove-check_conflicting_opens-warning.patch

fs/nfsd/nfs4state.c

index 47006eec724e61f772317634bf2e696ed666051e..894cba1294f0610a3685edae711927fb25bfd690 100644 (file)
@@ -4957,6 +4957,7 @@ static int nfsd4_check_conflicting_opens(struct nfs4_client *clp,
                writes--;
        if (fp->fi_fds[O_RDWR])
                writes--;
+       WARN_ON_ONCE(writes < 0);
        if (writes > 0)
                return -EAGAIN;
        spin_lock(&fp->fi_lock);